import http from '../commons/utils/axios-util';

/**
 * 仪表板
 */
export default class DashboardApi {
  public static REQUEST_PREFIX = 'visual/dashboard/';

  /**
   * 保存仪表板
   * @param params
   */
  static saveDashboard(params: any) {
    return http.post(`${DashboardApi.REQUEST_PREFIX}saveDashboard`, params);
  }

  /**
   * 初始仪表板管理数据
   * @param params
   */
  static initDashboardListData(params: any) {
    return http.get(`${DashboardApi.REQUEST_PREFIX}initDashboardListData`, params);
  }

  /**
   * 获取仪表板分页列表数据
   * @param params
   */
  static queryDashboardPageList(params: any) {
    return http.post(`${DashboardApi.REQUEST_PREFIX}queryDashboardPageList`, params);
  }

  /**
   * 初始化仪表板添加数据
   * @param params
   * @returns
   */
  static initDashboardAddData(id: string) {
    return http.get(`${DashboardApi.REQUEST_PREFIX}initDashboardAddData?id=${id}`);
  }

  /**
   * 删除仪表板数据
   * @param params
   * @returns
   */
  static deleteDashboardByIds(params: any) {
    return http.post(`${DashboardApi.REQUEST_PREFIX}deleteDashboardByIds`, params);
  }
}
